/*=================================页面事件============================================================*/
function optionsLoad(){
	if(bXmlHttpSupport) {
    	var sUrl = 'queryOptionsList.action';
        var request = new XMLHttpRequest();
        request.onreadystatechange = function() {
        	if(request.readyState == 4) {
            	var oRequest = eval('(' + request.responseText + ')');
            	var optionsList = oRequest.optionsList;
            	//alert(request.responseText);
            	putOptionsList(optionsList);
			}
    	};
    	request.open('POST', sUrl);
    	request.setRequestHeader("Content-Type","application/x-www-form-urlencoded"); 
    	request.send(null);
    }
}

function updateOptions(){
	if(bXmlHttpSupport) {
    	var sUrl = 'updateOptionsList.action';
    	var params = 	"optionsList[0].setValue="+rowCountPerPage.value +
    					"&optionsList[1].setValue="+rowCountPerPageForDisplay.value +
    					"&optionsList[2].setValue="+maxPageInBar.value;
        var request = new XMLHttpRequest();
        request.onreadystatechange = function() {
        	if(request.readyState == 4) {
            	var oRequest = eval('(' + request.responseText + ')');
            	var result = oRequest.result;
            	returnMsg.innerHTML = result;
            	
			}
    	};
    	request.open('POST', sUrl);
    	request.setRequestHeader("Content-Type","application/x-www-form-urlencoded"); 
    	request.send(params);
    }
}

/*=================================数据展示============================================================*/
//把取到的值展示到页面上
function putOptionsList(optionsList){
	rowCountPerPage.value = optionsList[0].setValue;
	rowCountPerPageForDisplay.value = optionsList[1].setValue;
	maxPageInBar.value = optionsList[2].setValue;
}